<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>LCV Framework: dip.c Quellcode</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Erzeugt von Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Hauptseite</span></a></li>
    <li><a href="classes.html"><span>Datenstrukturen</span></a></li>
    <li class="current"><a href="files.html"><span>Dateien</span></a></li>
  </ul>
</div>
<h1>dip.c</h1><a href="dip_8c.html">gehe zur Dokumentation dieser Datei</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;fcntl.h&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;strings.h&gt;</span>
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 <span class="preprocessor">#include "<a class="code" href="lcv-structs_8h.html" title="Definiert spezifische Strukturen für die LCV.">lcv-structs.h</a>"</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include "<a class="code" href="lcv-config_8h.html" title="Enthält die allgemeinen Definitionen des LCV Frameworks.">lcv-config.h</a>"</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include "<a class="code" href="dip_8h.html" title="Digital Image Processing Funktionen.">dip.h</a>"</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="dip_8h.html#3207c4aea24dad8d08ad3ded4f6ba876">00020</a> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> <a class="code" href="dip_8c.html#3207c4aea24dad8d08ad3ded4f6ba876" title="Fertigt eine Kopie eines Bildes an, inklusive aller Parameter.">lcv_clone_picture</a>(<span class="keyword">const</span> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a>* pic)
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> res_pic;
<a name="l00023"></a>00023         
<a name="l00024"></a>00024         res_pic.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> = pic-&gt;<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a>;
<a name="l00025"></a>00025         res_pic.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a>;
<a name="l00026"></a>00026         res_pic.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a> = pic-&gt;<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a>;
<a name="l00027"></a>00027         res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>;
<a name="l00028"></a>00028         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)malloc(pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00029"></a>00029         (void)memcpy(res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>, pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>, pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);             
<a name="l00030"></a>00030         <span class="keywordflow">return</span> res_pic;                                                    
<a name="l00031"></a>00031 }
<a name="l00032"></a>00032 
<a name="l00033"></a><a class="code" href="dip_8h.html#7043e383be4ca95f8b41acee08c8eba9">00033</a> <span class="keywordtype">void</span> <a class="code" href="dip_8c.html#7043e383be4ca95f8b41acee08c8eba9">lcv_free_picture</a>(<a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a>* pic)
<a name="l00034"></a>00034 {
<a name="l00035"></a>00035         free(pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>);        
<a name="l00036"></a>00036 }
<a name="l00037"></a>00037 
<a name="l00038"></a><a class="code" href="dip_8h.html#44ed40cd097d1bfce8480855457071ae">00038</a> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> <a class="code" href="dip_8c.html#44ed40cd097d1bfce8480855457071ae" title="Invertiert Bild.">lcv_invert</a>(<span class="keyword">const</span> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a>* pic)
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> res_pic;
<a name="l00041"></a>00041         <span class="keywordtype">int</span> i;
<a name="l00042"></a>00042         
<a name="l00043"></a>00043         res_pic.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> = pic-&gt;<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a>;
<a name="l00044"></a>00044         res_pic.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a>;
<a name="l00045"></a>00045         res_pic.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a> = pic-&gt;<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a>;
<a name="l00046"></a>00046         res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>;
<a name="l00047"></a>00047         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)malloc(pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00048"></a>00048         
<a name="l00049"></a>00049         
<a name="l00050"></a>00050         <span class="keywordflow">for</span> (i=0; i&lt;res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>; i++) {
<a name="l00051"></a>00051                 res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i] = 255 - pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i];
<a name="l00052"></a>00052         }
<a name="l00053"></a>00053         
<a name="l00054"></a>00054         <span class="keywordflow">return</span> res_pic;
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056 
<a name="l00057"></a><a class="code" href="dip_8h.html#68b064713e293ce23b6d9f5023449928">00057</a> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> <a class="code" href="dip_8c.html#68b064713e293ce23b6d9f5023449928" title="Spiegelt Bild.">lcv_reverse</a>(<span class="keyword">const</span> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a>* pic)
<a name="l00058"></a>00058 {
<a name="l00059"></a>00059         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> res_pic;
<a name="l00060"></a>00060         <span class="keywordtype">int</span> i;
<a name="l00061"></a>00061         
<a name="l00062"></a>00062         res_pic.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> = pic-&gt;<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a>;
<a name="l00063"></a>00063         res_pic.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a>;
<a name="l00064"></a>00064         res_pic.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a> = pic-&gt;<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a>;
<a name="l00065"></a>00065         res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>;
<a name="l00066"></a>00066         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)malloc(pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00067"></a>00067         
<a name="l00068"></a>00068         <span class="keywordflow">if</span> (res_pic.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> == <a class="code" href="lcv-structs_8h.html#b1860e6c3843411127d01321e616fd2439e6c4bfc9522eeea7cc640aa2e2d62a">IMG_GRAYSCALE</a>) {
<a name="l00069"></a>00069                 <span class="keywordflow">for</span> (i=0; i&lt;res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>; i++) {
<a name="l00070"></a>00070                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> - 1 - i] = pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i];
<a name="l00071"></a>00071                 }
<a name="l00072"></a>00072         } <span class="keywordflow">else</span> {
<a name="l00073"></a>00073                 <span class="keywordflow">for</span> (i=0; i&lt;res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>; i = i+3) {
<a name="l00074"></a>00074                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> - 1 - i - 2] = pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i];
<a name="l00075"></a>00075                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> - 1 - i - 1] = pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i+1];
<a name="l00076"></a>00076                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> - 1 - i] = pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i+2];
<a name="l00077"></a>00077                 }
<a name="l00078"></a>00078         }
<a name="l00079"></a>00079         <span class="keywordflow">return</span> res_pic;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 
<a name="l00082"></a><a class="code" href="dip_8h.html#e5f25b2e1cb17f96c78edb030c185087">00082</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="dip_8c.html#e5f25b2e1cb17f96c78edb030c185087" title="Berechnet den Durchschnittswert eines Bildes.">lcv_avg_value</a>(<span class="keyword">const</span> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a>* pic)
<a name="l00083"></a>00083 {
<a name="l00084"></a>00084         <span class="keywordtype">int</span> i;
<a name="l00085"></a>00085         <span class="keywordtype">int</span> value = 0;
<a name="l00086"></a>00086         
<a name="l00087"></a>00087         <span class="keywordflow">for</span> (i=0; i &lt; pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>; i++) {
<a name="l00088"></a>00088                 value += pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i];
<a name="l00089"></a>00089         }
<a name="l00090"></a>00090         
<a name="l00091"></a>00091         <span class="keywordflow">return</span> (value / i);
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 
<a name="l00094"></a><a class="code" href="dip_8h.html#d04debfd2555f7c1a887bb29f2d18e94">00094</a> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> <a class="code" href="dip_8c.html#d04debfd2555f7c1a887bb29f2d18e94" title="Wandelt ein 24Bit BGR Bild in ein 8Bit Graustufenbild um.">lcv_rgb2gray</a>(<span class="keyword">const</span> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a>* pic)
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> res_pic;
<a name="l00097"></a>00097         <span class="keywordtype">int</span>             gray_value;
<a name="l00098"></a>00098         <span class="keywordtype">int</span> i;  
<a name="l00099"></a>00099         
<a name="l00100"></a>00100         res_pic.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a>;
<a name="l00101"></a>00101         res_pic.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a> = pic-&gt;<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a>;     
<a name="l00102"></a>00102         res_pic.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> = <a class="code" href="lcv-structs_8h.html#b1860e6c3843411127d01321e616fd2439e6c4bfc9522eeea7cc640aa2e2d62a">IMG_GRAYSCALE</a>;
<a name="l00103"></a>00103         
<a name="l00104"></a>00104         <span class="keywordflow">if</span> (pic-&gt;<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> != <a class="code" href="lcv-structs_8h.html#b1860e6c3843411127d01321e616fd2439e6c4bfc9522eeea7cc640aa2e2d62a">IMG_GRAYSCALE</a>) {
<a name="l00105"></a>00105                 res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> / 3;
<a name="l00106"></a>00106                 res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)malloc(res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00107"></a>00107                 
<a name="l00108"></a>00108                 <span class="keywordflow">for</span> (i = 0; i &lt; pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> ; i = i+3) {                        
<a name="l00109"></a>00109                         gray_value = (pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i] + pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i+1] + pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i+2]) / 3;                      
<a name="l00110"></a>00110                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i/3] = gray_value;         
<a name="l00111"></a>00111                 }
<a name="l00112"></a>00112         } <span class="keywordflow">else</span> {
<a name="l00113"></a>00113                 res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>;
<a name="l00114"></a>00114                 res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)malloc(pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00115"></a>00115                 (void)memcpy(res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>, pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>, pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00116"></a>00116         }
<a name="l00117"></a>00117         <span class="keywordflow">return</span> res_pic;
<a name="l00118"></a>00118 }
<a name="l00119"></a>00119 
<a name="l00120"></a><a class="code" href="dip_8h.html#0e7dc12ed58b8d050583d2a8b78118a6">00120</a> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> <a class="code" href="dip_8c.html#0e7dc12ed58b8d050583d2a8b78118a6" title="Wandelt ein 8Bit Graustufenbild in ein 24Bit BGR Bild um.">lcv_gray2rgb</a>(<span class="keyword">const</span> <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a>* pic)
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122         <a class="code" href="structlcv__picture.html" title="Bilderstruktur für unsigned 8-bit Bilder.">lcv_picture</a> res_pic;
<a name="l00123"></a>00123         <span class="keywordtype">int</span> i;  
<a name="l00124"></a>00124         
<a name="l00125"></a>00125         res_pic.<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1fedb162e9fe3b19a1a70c24009a468">height</a>;
<a name="l00126"></a>00126         res_pic.<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a> = pic-&gt;<a class="code" href="structlcv__picture.html#e83ac2254761aa2c6678f140565ddf52">width</a>;     
<a name="l00127"></a>00127         res_pic.<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> = <a class="code" href="lcv-structs_8h.html#b1860e6c3843411127d01321e616fd24ac1f6d8408e4448449149fc6ee90de65">IMG_BGR</a>;
<a name="l00128"></a>00128         
<a name="l00129"></a>00129         <span class="keywordflow">if</span>(pic-&gt;<a class="code" href="structlcv__picture.html#6bc2403299e0f61e26c4ade67d0ccacf">type</a> != <a class="code" href="lcv-structs_8h.html#b1860e6c3843411127d01321e616fd24ac1f6d8408e4448449149fc6ee90de65">IMG_BGR</a>){
<a name="l00130"></a>00130                 res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> * 3;
<a name="l00131"></a>00131                 res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)malloc(res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00132"></a>00132                 
<a name="l00133"></a>00133                 <span class="keywordflow">for</span> (i = 0; i &lt; res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> ; i = i+3) {     
<a name="l00134"></a>00134                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i] = pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i/3];
<a name="l00135"></a>00135                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i+1] = pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i/3];
<a name="l00136"></a>00136                         res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i+2] = pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>[i/3];
<a name="l00137"></a>00137                 }
<a name="l00138"></a>00138         } <span class="keywordflow">else</span> {
<a name="l00139"></a>00139                 res_pic.<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a> = pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>;
<a name="l00140"></a>00140                 res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a> = (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)malloc(pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00141"></a>00141                 (void)memcpy(res_pic.<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>, pic-&gt;<a class="code" href="structlcv__picture.html#2c2b64613effb4dccb763bb5ba4670f6">data</a>, pic-&gt;<a class="code" href="structlcv__picture.html#d1be6c681d8345ac3bbc3820ed8e3fee">length</a>);
<a name="l00142"></a>00142         }
<a name="l00143"></a>00143         <span class="keywordflow">return</span> res_pic;
<a name="l00144"></a>00144 }
</pre></div><hr size="1"><address style="text-align: right;"><small>Erzeugt am Wed Dec 19 16:38:17 2007 für LCV Framework von&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>
